'use strict';

/*对话页面　，两种type　　解决中＝１　已解决＝２*/

var React = require('react');
var Router = require('react-router'); 
var RouteHandler = Router.RouteHandler;

var LayoutPanel = require('../../modules/layoutPanel.jsx');
var RitopLast = require('../../modules/ritopLast.jsx');
var RibomLast = require('../../modules/ribomLast.jsx');

var DialogueTop = require('../../modules/dialogueTop.jsx');
var DialogueCenter = require('../../modules/dialogueCenter.jsx');
var DialogueBottom = require('../../modules/dialogueBottom.jsx');




var DialogueComponent = React.createClass({
  getInitialState:function(){
  	return {panelType:parseInt(this.props.params.type),el:null};
  },
  componentWillMount:function(){
  	if (this.state.panelType==1) {
  		this.setState({el:<DialogueBottom/>});
  	};
  },
  render: function() {
  	var style;
  	if (this.state.panelType==2) {
  	  style = {paddingBottom:55};
  	}
    return (
	/* jshint ignore:start */
			<div className="pure-g">
				<div className="do-there-left">
					<div className="do-page-dialogue-warp" style={style}>
						<DialogueTop panelType={this.state.panelType}/>
						<DialogueCenter panelType={this.state.panelType}/>
						{this.state.el}
					</div>
				</div>
				<LayoutPanel topView = {<RitopLast/>} bomView = {<RibomLast/>} />
				<RouteHandler {...this.props}/>
			</div>
	/* jshint ignore:end */
    );
  }
});

module.exports =DialogueComponent;
